﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Business;

namespace TimKiemDiaDiem
{
    public partial class TimKiemCtrl : UserControl
    {

        public IfrmTimKiem FrmTimKiem
        {
            set { m_LoaiTimKiem.FrmTimKiem = value; }
        }

        public String TenDichVu
        {
            set { m_LoaiTimKiem.TenDichVu = value; }
        }
        public TimKiemCtrl()
        {
            InitializeComponent();
            this.Size = new Size(526, 125);
            m_LoaiTimKiem = new TimKiemDonGianCtrl();
            this.Controls.RemoveAt(this.Controls.Count - 1);
            this.Controls.Add(m_LoaiTimKiem);
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        public void DoiLoaiTimKiem(LoaiTimKiemCtrl LoaiTimKiem)
        {
            LoaiTimKiem.TenDichVu = m_LoaiTimKiem.TenDichVu;
            LoaiTimKiem.FrmTimKiem = m_LoaiTimKiem.FrmTimKiem;

            m_LoaiTimKiem = LoaiTimKiem;
            this.Controls.RemoveAt(this.Controls.Count - 1);
            this.Controls.Add(m_LoaiTimKiem);
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        public void TraCuuDiaDiem()
        {
            this.m_LoaiTimKiem.TraCuu();
        }

    }
}
